package com.tiandao.mofang.core.richang;

import com.tiandao.mofang.core.RobotSingleton;
import com.tiandao.mofang.core.util.YiDong;
import com.tiandao.mofang.ui.MFFrame;

import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.Date;

/**
 * 东岳万蝶坪  异域来客 (阿美)
 * 收集 黄茉莉  野金桂
 * 2020年8月18日18:42:45
 */
public class DywdYylk implements Runnable {

    private static Robot robot = RobotSingleton.getInstance();
    //黄茉莉坐标 4个
    public static String HML_ONE_X = "884";
    public static String HML_ONE_Y = "844";
    public static String HML_TWO_X = "887";
    public static String HML_TWO_Y = "823";
    public static String HML_THR_X = "865";
    public static String HML_THR_Y = "819";
    public static String HML_FOU_X = "817";
    public static String HML_FOU_Y = "826";

    //野金桂坐标 4个
    public static String YJG_ONE_X = "837";
    public static String YJG_ONE_Y = "678";
    public static String YJG_TWO_X = "871";
    public static String YJG_TWO_Y = "656";
    public static String YJG_THR_X = "810";
    public static String YJG_THR_Y = "694";
    public static String YJG_FOU_X = "775";
    public static String YJG_FOU_Y = "687";
    public static void main(String[] args){
        start();
    }
    @Override
    public void run() {
        start();
    }

    //开始
    public static void start(){
        try {
            Thread.sleep(5000);
            YiDong.yfsxqdt(625,775,YiDong.QDT_DONG_YUE_Y);
            Thread.sleep(15000);
            MFFrame.textArea.append(new Date()+":    到达杭州!\n");
            robot.keyPress(KeyEvent.VK_6);
            robot.keyRelease(KeyEvent.VK_6);
            Thread.sleep(1500);
            YiDong.zouLu("835","866");
            Thread.sleep(75000);
            MFFrame.textArea.append(new Date()+":    到达任务地点!\n");
            robot.keyPress(KeyEvent.VK_F);
            robot.keyRelease(KeyEvent.VK_F);
            Thread.sleep(2500);
            robot.mouseMove(240,548);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            //去拾取黄茉莉
            for(int x = 1;x<=9;x++){
                if(x==1){
                    YiDong.zouLu(HML_ONE_X,HML_ONE_Y);
                    Thread.sleep(15000);
                    robot.keyPress(KeyEvent.VK_F);
                    robot.keyRelease(KeyEvent.VK_F);
                    Thread.sleep(1500);
                }
                if(x==4){
                    YiDong.zouLu(HML_TWO_X,HML_TWO_Y);
                    Thread.sleep(15000);
                    robot.keyPress(KeyEvent.VK_F);
                    robot.keyRelease(KeyEvent.VK_F);
                    Thread.sleep(1500);
                }
                if(x==7){
                    YiDong.zouLu(HML_THR_X,HML_THR_Y);
                    Thread.sleep(15000);
                    robot.keyPress(KeyEvent.VK_F);
                    robot.keyRelease(KeyEvent.VK_F);
                    Thread.sleep(1500);
                }
                Thread.sleep(12000);
                robot.keyPress(KeyEvent.VK_F);
                robot.keyRelease(KeyEvent.VK_F);
                Thread.sleep(1500);
            }
            //上马去下一个地点
            robot.keyPress(KeyEvent.VK_6);
            robot.keyRelease(KeyEvent.VK_6);
            Thread.sleep(1500);
            YiDong.zouLu("775","687");
            Thread.sleep(25000);
            for(int x = 1;x<=9;x++){
                if(x==1){
                    YiDong.zouLu(YJG_ONE_X,YJG_ONE_Y);
                    Thread.sleep(15000);
                    robot.keyPress(KeyEvent.VK_F);
                    robot.keyRelease(KeyEvent.VK_F);
                    Thread.sleep(1500);
                }
                if(x==4){
                    YiDong.zouLu(YJG_TWO_X,YJG_TWO_Y);
                    Thread.sleep(15000);
                    robot.keyPress(KeyEvent.VK_F);
                    robot.keyRelease(KeyEvent.VK_F);
                    Thread.sleep(1500);
                }
                if(x==7){
                    YiDong.zouLu(YJG_THR_X,YJG_THR_Y);
                    Thread.sleep(15000);
                    robot.keyPress(KeyEvent.VK_F);
                    robot.keyRelease(KeyEvent.VK_F);
                    Thread.sleep(1500);
                }
                Thread.sleep(12000);
                robot.keyPress(KeyEvent.VK_F);
                robot.keyRelease(KeyEvent.VK_F);
                Thread.sleep(1500);
            }

            //回去找阿美
            robot.keyPress(KeyEvent.VK_6);
            robot.keyRelease(KeyEvent.VK_6);
            Thread.sleep(1500);
            YiDong.zouLu("835","866");
            Thread.sleep(26000);
            robot.keyPress(KeyEvent.VK_F);
            robot.keyRelease(KeyEvent.VK_F);
            Thread.sleep(2500);
            robot.mouseMove(240,548);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            MFFrame.textArea.append(new Date()+":    日常完成!\n");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
